package com.jy.adscm.spss.controller;


import com.jy.adscm.spss.bean.SBPrice;
import com.jy.adscm.spss.service.ComponertService;
import com.jy.adscm.support.SimpleCoreResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.beans.SimpleBeanInfo;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yyy
 * @since 2018-11-08
 */
@RestController
@RequestMapping("adscm/operation/lj")
public class ComponentController {
    @Autowired
    ComponertService componertService;
    @RequestMapping("/cost")
    public SimpleCoreResponse getCost(String dateTime) throws Exception{
        return new SimpleCoreResponse("200","查询成功",componertService.getCost(dateTime));
    }
    @RequestMapping("/ColumnarDate")
    public SimpleCoreResponse getColumnarDate(String detailname) throws Exception{
        return new SimpleCoreResponse("200","查询成功",componertService.getColumnarDate(detailname));
    }
    @RequestMapping("/PartsName")
    public SimpleCoreResponse getPartsName(){
        return new SimpleCoreResponse("200","查询成功",componertService.getPartsName());
    }
    @RequestMapping("/updatePrice")
    public SimpleCoreResponse updatePrice(SBPrice sbPrice){
        return new SimpleCoreResponse("200","修改成功",componertService.updateSbPrice(sbPrice));
    }

    @RequestMapping("/getPrice")
    public SimpleCoreResponse getPrice(){
        return new SimpleCoreResponse("200","查询成功",componertService.getPrice());
    }

    @RequestMapping("/getOnlyName")
    public SimpleCoreResponse getOnlyName(){
        return new SimpleCoreResponse("200","查询成功",componertService.getOnlyDetailName());
    }

    @RequestMapping("/getDetail")
    public SimpleCoreResponse getDetail(String name){
        return new SimpleCoreResponse("200","查询成功",componertService.getZJKDetail(name));

    }

    @RequestMapping("/getZJKStacking")
    public SimpleCoreResponse getZJKStacking(){
        return new SimpleCoreResponse("200","查询成功",componertService.getZJKStacking());
    }

    @RequestMapping("/getByNameAndAll")
    public SimpleCoreResponse getByNameAndAll(String name){
        return new SimpleCoreResponse("200","查询成功",componertService.getByNameAndAll(name));
    }
    @RequestMapping("/getOnlyLjName")
    public SimpleCoreResponse getOnlyLjName(){
        return new SimpleCoreResponse("200","查询成功",componertService.getOnlyLjName());
    }

    @RequestMapping("/loadYlkDetail")
    public SimpleCoreResponse loadYlkDetail(String name){
        return new SimpleCoreResponse("200","查询成功",componertService.loadYlkDetail(name));

    }
    @RequestMapping("/loadYlkName")
    public SimpleCoreResponse loadYlkName(){
        return new SimpleCoreResponse("200","查询成功",componertService.loadYlkName());
    }
    @RequestMapping("/getYLKStacking")
    public SimpleCoreResponse getYLKStacking(){
        return new SimpleCoreResponse("200","查询成功",componertService.getYlKStacking());
    }
}

